import { defineStore } from 'pinia';
import { ref } from 'vue';
//用户模块
export const useCounterStore = defineStore(
  'counter',
  () => {
    const count = ref(0);
    const addCount = () => {
      count.value++;
    };

    return {
      count,
      addCount
    };
  },
  // { persist: true },
  {
    persist: {
      storage: sessionStorage,
      paths: ['count']
    }
  }
);
